<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
    <h2>上传成功  </h2>  
       <a href="">下载</a>
       
       <button onclick="sendJson()">发送一个请求</button>
</body>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
   function sendJson(){
	   alert("111");
	   // 将一个json对象 转成 json字符串 
	   var users =JSON.stringify( [{"id":1001,"uname":"zhansan","age":20},
		         {"id":1002,"uname":"lisi","age":20}]
	   );
	   alert(users);
	   
	   $.ajax({
		   type:"POST",
		   url:"testJsonList2",
		   data:users,
	       contentType:"application/json",  // 请求的参数是 json格式
	       dataType :"JSON",  // 响应的数据是json格式
	   	   success:function(result){
	   		   alert(result[0].uname);
	   		   
	   	   }
	   });
	   
   }

</script>
</html>